#include "ODGlobal.h"

std::unique_ptr<FODWorldData> ImportODWorld(const std::string& content)
{
	std::unique_ptr<FODWorldData> ret(new FODWorldData());
	try {
		ret->EntityManager.Reset(content);
		ret->EntityManager.Region(
			0,
			0,
			0,
			0,
			1234,
			4567);
		ret->EntityManager.GetAll(ret->CachedRoads);
	}
	catch (std::exception&) {
		return nullptr;
	}

	FWorldEntityHeader::Ptr header = ret->EntityManager.Header();
	if (header)
	{
		ret->EntityAxis = header->Axis;
	}
	else
	{
		ret->EntityAxis = FWorldEntityAxis::Unknown();
	}

	return ret;
}

